<template>
  <div class="app-container">


    <!-- vxe检索数据组件 -->
    <search-form
      ref="searchForm"
      :formSearchData.sync="formSearchData"
      :bsCvCodeOptions="baseCurveSelectOptions"
      :tfCvCodeOptions="transferCurveSelectOptions"
      :findstaytypeSelectOptions="findstay_typeSelectOptions"
      :findsppsttypeSelectOptions="findsppst_typeSelectOptions"
      :findmergetypeSelectOptions="findmerge_typeSelectOptions"
      @searchEventEmit="searchEventEmit"
      @resetSearchEventEmit="resetSearchEventEmit"
    >
    </search-form>


    <!-- 表格组件 -->
    <ex-base-table
      ref="exBaseTable"
      :isVxeColSeq="false"
      :isVxeCheckbox="false"
      :tableColumn="tableColumn"
      :tableData="tableData"
      :loading.sync="loading"
      @handleRemoveEmit="handleRemoveEmit"
      @handleCreateEmit="handleCreateEmit"
      @handleUpdateEmit="handleUpdateEmit"
      @handleRmoveColEmit="handleRmoveColEmit"
      @customSortMethodEmit="customSortMethodEmit"
    >
     <!-- 操作栏按钮扩展插槽 -->
      <template v-slot:handleExtend="{row}">
        &nbsp;
        <el-popconfirm
          :confirm-button-text="$t('base.affirm')"
          :cancel-button-text="$t('base.cancel')"
          icon="el-icon-info"
          icon-color="red"
          title="确定同步？"
          @confirm="synctcd(row)"
        >
          <el-button slot="reference" size="mini" type="text">同步</el-button>
        </el-popconfirm>
        &nbsp;
        <el-button type="text" size="mini" @click="viewTimePointsManageTable(row)">
          <!-- 期限点数字符串 -->
          期限点
        </el-button>

      </template>
    </ex-base-table>

    <!-- 分页组件 -->
    <Pagination
      v-show="tablePage.totalResult>0"
      :total="tablePage.totalResult"
      :page.sync="tablePage.currentPage"
      :limit.sync="tablePage.pageSize"
      @pagination="pageFindList"
    />


    <!-- 表单提价组件 -->
    <submit-form
      ref="submitForm"
      :dialogFormVisible.sync="dialogFormVisible"
      :dialogStatus="dialogStatus"
      :formSubmitData="formSubmitData"
      :lpOptions="lpOptions"
      :stayTypeOptions="stayTypeOptions"
      :sppstTypeOptions="sppstTypeOptions"
      :mergeTypeOptions="mergeTypeOptions"
      :stayCurveCodeOptions="stayCurveCodeOptions"
      :sppstCurveCodeOptions="sppstCurveCodeOptions"
      :mergeCurveCodeOptions="mergeCurveCodeOptions"
      @handleFromUpdateDataEmit="handleFromUpdateDataEmit"
      @handleFromCreateDataEmit="handleFromCreateDataEmit"
      @resetFormDataEmit="resetFormSubmitData"
      @stayTypeChangeEmit="stayTypeChangeEmit"
      @sppstTypeChangeEmit="sppstTypeChangeEmit"
      @mergeTypeChangeEmit="mergeTypeChangeEmit"
    >
    </submit-form>



    <!-- 弹出表格-期限点数字符串 -->
    <el-dialog
      :title="dialogTimePointsManageTableVisible_title"
      width="80%"
      :visible.sync="dialogTimePointsManageTableVisible"
    >
      <TimePointsManageTable
        ref="timePointsManageTable"
        :currentRow="currentRow"
        @handleFindListEmit="findList"
      />
    </el-dialog>

  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
// import PageHeaderLayout from '@/layouts/PageHeaderLayout'
// import ApeDrawer from '@/components/ApeDrawer'
// import { mapGetters } from 'vuex'
import cvoptions from '@/views/CurveManageNew/mixins/cvoptions'
import XEUtils from 'xe-utils'

import {
  findTCCurveSuperposition,
  deleteTCCurveSuperposition,
  addTCCurveSuperposition,
  updateTCCurveSuperposition,
  deleteTCCurveSuperpositionBatch,
  tcDirectReferenceFindlpname,
  syncTCCurveSuperposition,
  findstay_type,
  findsppst_type,
  findmerge_type,
  tCCurveSuperpositionFindsppstType,
  tCCurveSuperpositionFingcurve,
  tCCurveSuperpositionFindtermCode

} from './service/baseApi'


// 基础表格组件
import ExBaseTable from './components/ExBaseTable'
// 分页
import Pagination from '@/components/Pagination'
// 文章表单
import SubmitForm from './components/SubmitForm'
// 检索表单
import SearchForm from './components/SearchForm'
//信息提示框
import {MessageBox, Message} from 'element-ui'

import TimePointsManageTable from './components/TimePointsManageTable'

import resetFormSubmitData from '@/views/mixins/resetFormSubmitData'

export default {
  name: 'vxe-basetable',
  mixins: [cvoptions,resetFormSubmitData],
  components: {
    ExBaseTable,
    Pagination,
    SubmitForm,
    SearchForm,
    TimePointsManageTable
  },
  // 定义属性
  data() {
    return {
      // 检索条件
      formSearchData: {
        stay_curve_code: '',
        sppst_curve_code: '',
        merge_curve_code: ''
        /* 以下是示例 筛选表单按钮 */
        // name: '',
        // role: '',
        // sex: null,
        // age: null,
        // region: [],
        // date: null,
        // date5: null,
        // flag: false,
        // slider: 0,
        // rate: 0,
        // flag1: '',
        // checkedList: []
      },
       //曲线待下拉框
      findstay_typeOptions:[],
      findstay_typeSelectOptions:[],
      //曲线叠下拉框
      findsppst_typeOptions:[],
      findsppst_typeSelectOptions:[],
      //曲线合下拉框
      findmerge_typeOptions:[],
      findmerge_typeSelectOptions:[],

      // 排除条件
      sortField: '',
      sortFlag: '',

      /* 表单相关 */
      dialogFormVisible: false, // 修改删除弹出框
      dialogStatus: '',
      // 表单数据对象
      formSubmitData: {
        id: "",
        lp_code:"",
        s_date:"", //生效日期
        e_date:"", //失效日期
        // exct_fqc: '',
        // 拟合频率-分 1-60 * 
        exct_fqc_minute:'*',
        // 拟合频率-时 1-24 *
        exct_fqc_hour:'*',
        // 拟合频率-天 1-31 *
        exct_fqc_day:'*',
        // 拟合频率-星期 1-7  
        exct_fqc_week:'*',
        // 拟合频率-月 1-12 
        exct_fqc_month:'*',
        stay_type:"", //类型--待
        stay_curve_code:"", //曲线--待
        // stay_term_code:"", //期限点编号--待
        // stay_pct_value:"", //值--待

        sppst_type:"", //类型--叠
        sppst_curve_code:"", //曲线--叠
        // sppst_term_code:"", //期限点编号--叠
        // sppst_pct_value:"", //值--叠

        merge_type:"", //类型--合
        merge_curve_code:"", //曲线--合
        // merge_term_code:"", //期限点编号--合
        //merge_term_code:"", //值--合 不需要传入

        // rfr_value:"", //参照倍数
        remark:"", //备注
      },
      initFormSubmitData:{
        id: "",
        lp_code:"",
        s_date:"", //生效日期
        e_date:"", //失效日期
        // exct_fqc: '',
        // 拟合频率-分 1-60 * 
        exct_fqc_minute:'*',
        // 拟合频率-时 1-24 *
        exct_fqc_hour:'*',
        // 拟合频率-天 1-31 *
        exct_fqc_day:'*',
        // 拟合频率-星期 1-7  
        exct_fqc_week:'*',
        // 拟合频率-月 1-12 
        exct_fqc_month:'*',
        stay_type:"", //类型--待
        stay_curve_code:"", //曲线--待
        // stay_term_code:"", //期限点编号--待
        // stay_pct_value:"", //值--待

        sppst_type:"", //类型--叠
        sppst_curve_code:"", //曲线--叠
        // sppst_term_code:"", //期限点编号--叠
        // sppst_pct_value:"", //值--叠

        merge_type:"", //类型--合
        merge_curve_code:"", //曲线--合
        // merge_term_code:"", //期限点编号--合
        //merge_term_code:"", //值--合 不需要传入

        // rfr_value:"", //参照倍数
        remark:"", //备注
      },
      //类型--待
      stayTypeOptions: [],
      //类型--叠
      sppstTypeOptions: [],
      //类型--合
      mergeTypeOptions: [],

      //曲线--待
      stayCurveCodeOptions: [],
      //曲线--叠
      sppstCurveCodeOptions: [],
      //曲线--合
      mergeCurveCodeOptions: [],

     

      /* 分页相关 */
      tablePage: {
        currentPage: 1, //当前页
        pageSize: 10,  // 每一页页数
        totalResult: 0
      },
      /* 表格相关 */
      tableColumn: [], // 表格字段
      loading: false, //表格loading特效
      tableData: [],  //表格数据


      /* 子表相关-期限字符串 */
      dialogTimePointsManageTableVisible: false,
      dialogTimePointsManageTableVisible_title:'',
      /* 当前选中行数据 */
      currentRow: {},
      

    } //datareturn-end

  },
  // 计算属性，会监听依赖属性值随之变化
  computed: {
    formSubmitDataSDate(){
        return this.formSubmitData.s_date
    },
    formSubmitDataEDate(){
        return this.formSubmitData.e_date
    }
  },
  // 监控data中的数据变化
  watch: {
    // formSubmitDataSDate(){
      // alert(this.formSubmitData.s_date);
      // alert(this.formSubmitData.e_date);
      // if (XEUtils.isEmpty(this.formSubmitData.s_date || XEUtils.isEmpty(this.formSubmitData.e_date))) {
        //期限点编号--待
        // this.stayTermCodeOptions = []
        // this.formSubmitData.stay_term_code = ''
        //期限点编号--叠
        // this.sppstTermCodeOptions = []
        // this.formSubmitData.sppst_term_code = ''
        //期限点编号--合
        // this.mergeTermCodeOptions = []
        // this.formSubmitData.merge_term_code = ''
      // }
    // },
    // formSubmitDataEDate(){
    //   if (XEUtils.isEmpty(this.formSubmitData.s_date  || XEUtils.isEmpty(this.formSubmitData.e_date))) {
        //期限点编号--待
        // this.stayTermCodeOptions = []
        // this.formSubmitData.stay_term_code = ''
        // //期限点编号--叠
        // this.sppstTermCodeOptions = []
        // this.formSubmitData.sppst_term_code = ''
        // //期限点编号--合
        // this.mergeTermCodeOptions = []
        // this.formSubmitData.merge_term_code = ''
    //   }
    // }
  },
  // 方法集合
  methods: {


    /* API数据操作相关 */
    // 查询类型状态Options 
    findTCCurveSuperpositionFindsppstType(){
      tCCurveSuperpositionFindsppstType({
      }).then(({data}) => {
        console.log('tCCurveSuperpositionFindsppstType',data.rows);
        //类型--待
        this.stayTypeOptions = data.rows
        //类型--叠
        this.sppstTypeOptions = data.rows
        //类型--合
        this.mergeTypeOptions = data.rows
      }, error => {
        console.log('getList:error', error);
      })
    },
    // 查询曲线Options
    findTCCurveSuperpositionFingcurve(val,type){
      console.log('val',val);
      tCCurveSuperpositionFingcurve({
        type:val
      }).then(({data}) => {

        switch (type) {
          case 'stayType':
            this.stayCurveCodeOptions = data.rows
          break;
          case 'sppstType':
            this.sppstCurveCodeOptions = data.rows
          break;
          case 'mergeType':
            this.mergeCurveCodeOptions = data.rows
          break;
        
        }
      }, error => {
        console.log('getList:error', error);
      })
    },

    // 查询期限点 Options
    // findTCCurveSuperpositionFindtermCode(val,type){
    //   console.log('val',val);
    //   let apiType
    //   switch (type) {
    //     case 'stayType':
    //       apiType = this.formSubmitData.stay_type
    //     break;
    //     case 'sppstType':
    //       apiType = this.formSubmitData.sppst_type
    //     break;
    //     case 'mergeType':
    //       apiType = this.formSubmitData.merge_type
    //     break;
      
    //   }
    //   tCCurveSuperpositionFindtermCode({
    //     type:apiType,
    //     s_date:this.formSubmitData.s_date,
    //     e_date:this.formSubmitData.e_date,
    //     cv_code:val
    //   }).then(({data}) => {

    //     switch (type) {
    //       case 'stayType':
    //         this.stayTermCodeOptions = data.rows
    //       break;
    //       case 'sppstType':
    //         this.sppstTermCodeOptions = data.rows
    //       break;
    //       case 'mergeType':
    //         this.mergeTermCodeOptions = data.rows
    //       break;
        
    //     }
    //   }, error => {
    //     console.log('getList:error', error);
    //   })
    // },
    
    //类型--待Change
    stayTypeChangeEmit(val){
      // 初始化子集数据
      this.formSubmitData.stay_curve_code = ''
      // this.formSubmitData.stay_term_code = ''
      // this.stayTermCodeOptions = []
      
      this.findTCCurveSuperpositionFingcurve(val,'stayType')
    },
    //类型--叠Change
    sppstTypeChangeEmit(val){
      // 初始化子集数据
      this.formSubmitData.sppst_curve_code = ''
      // this.formSubmitData.sppst_term_code = ''
      // this.sppstTermCodeOptions = []

      this.findTCCurveSuperpositionFingcurve(val,'sppstType')
    },
    //类型--合Change
    mergeTypeChangeEmit(val){
      // 初始化子集数据
      this.formSubmitData.merge_curve_code = ''
      // this.formSubmitData.merge_term_code = ''
      // this.mergeTermCodeOptions = []

      this.findTCCurveSuperpositionFingcurve(val,'mergeType')
    },
    //曲线--待 Change
    // stayCurveCodeChangeEmit(val){
    //   this.isCheckSlecectDate((status)=>{
    //     if (status) {
    //       this.formSubmitData.stay_term_code = ''
    //       this.findTCCurveSuperpositionFindtermCode(val,'stayType')
    //     }
    //   })
    // },
    //曲线--叠 Change
    // sppstCurveCodeChangeEmit(val){
    //   this.isCheckSlecectDate((status)=>{
    //     if (status) {
    //       this.formSubmitData.sppst_term_code = ''
    //       this.findTCCurveSuperpositionFindtermCode(val,'sppstType')
    //     }
    //   })
    // },
    //曲线--合 Change
    // mergeCurveCodeChangeEmit(val){
    //   this.isCheckSlecectDate((status)=>{
    //     if (status) {
    //       this.formSubmitData.merge_term_code = ''
    //       this.findTCCurveSuperpositionFindtermCode(val,'mergeType')
    //     }
    //   })
    // },

    // 判断有没有选时间
    isCheckSlecectDate(row,_callBack){
      if (XEUtils.isEmpty(row.s_date) || XEUtils.isEmpty(row.e_date)) {
        this.$message({
          showClose: true,
          message: '请先选择生效日期和失效日期',
          type: 'warning'
        });
        return _callBack(false)
      }
      return _callBack(true)
    },
    // 查询数据
    findList() {
      /* TODO: 查询暂时没有api */
      this.loading = true
      console.log(' this.formSearchData:::', this.formSearchData);
      console.log('打印当前页：：：：', this.tablePage.currentPage);
      // 请求表格数据
      findTCCurveSuperposition({
        page: this.tablePage.currentPage, // 当前页
        pageSize: this.tablePage.pageSize, // 每页条数
        sortField: this.sortField,
        sortFlag: this.sortFlag,
        ...this.formSearchData,  //检索条件
      }).then(({data}) => {
        console.log('response:....', data);
        // 给表格数据赋值
        this.tableData = data.rows
        // 给分页总数赋值
        this.tablePage.totalResult = data.total
        // 关闭加载特效
        setTimeout(() => {
          this.loading = false
        }, 0.5 * 1000)
      }, error => {
        console.log('getList:error', error);
        // alert(error);
      })
    },

    /* 分页组件相关 */
    // 分页事件（页码切换，每页页数切换）
    pageFindList() {
      this.findList()
    },
    /* 表格组件相关 */
    // 初始化表格字段 
    initTableCols() {
      /* TODO: 显示字段未定义 */
      const tabCols = [  //动态增加的字段 传进来的
        // { field: 'te_date', title: '生效日期', width: 200 , showOverflow: true},
        {field: 'lp_name', title: '所属法人', width: 300, sortable: false},
        // {field: 'exct_fqc', title: '拟合频率', width: 200},
        {field: 'stay_type', title: '类型-待', width: 300, formatter(obj) {
            if (obj.cellValue == 1) {
              return "基础曲线"
            } else if (obj.cellValue == 2) {
              return "转移曲线"
            } else if (obj.cellValue == 3) {
              return "市场曲线"
            } 
          }
        },
        {field: 'stay_curve_name', title: '曲线名称-待', width: 200},

        {field: 'sppst_type', title: '类型-叠', width: 300, formatter(obj) {
            if (obj.cellValue == 1) {
              return "基础曲线"
            } else if (obj.cellValue == 2) {
              return "转移曲线"
            } else if (obj.cellValue == 3) {
              return "市场曲线"
            } 
          }
        },
        {field: 'sppst_curve_name', title: '曲线名称-叠', width: 200},

        {field: 'merge_type', title: '类型-合', width: 300, formatter(obj) {
            if (obj.cellValue == 1) {
              return "基础曲线"
            } else if (obj.cellValue == 2) {
              return "转移曲线"
            } else if (obj.cellValue == 3) {
              return "市场曲线"
            } 
          }
        },
        {field: 'merge_curve_name', title: '曲线名称-合', width: 200},
        {field: 's_date', title: '生效日期', width: 300},
        {field: 'e_date', title: '失效日期', width: 300},
        {field: 'status', title: '同步状态', width: 300, formatter(obj) {
            if (obj.cellValue == 1) {
              return "有效"
            } else if (obj.cellValue == 2) {
              return "同步中"
            } else if (obj.cellValue == 3) {
              return "同步失败"
            } else {
              return "同步成功"
            }
          }
        },
        {field: 'remark', title: '备注', width: 300}
      ]
      this.tableColumn = tabCols;
    },
    // 表格工具组-多选删除
    handleRemoveEmit(selectRecords) {
      this.$refs.exBaseTable.$refs.xTable.removeCheckboxRow()
      deleteTCCurveSuperpositionBatch({
        ...selectRecords
      }).then(({data}) => {
        console.log('response:....', data);

        this.findList()
        // 关闭加载特效

      }, error => {
        console.log('getList:error', error);
        // alert(error);
      })
    },
    // 表格工具组-新增表单弹窗（需要表单组件）
    handleCreateEmit(type) {
      //曲线--待
      this.stayCurveCodeOptions = []
      //曲线--叠
      this.sppstCurveCodeOptions = []
      //曲线--合
      this.mergeCurveCodeOptions = []

      // //期限点编号--待
      // this.stayTermCodeOptions = []
      // //期限点编号--叠
      // this.sppstTermCodeOptions = []
      // //期限点编号--合
      // this.mergeTermCodeOptions = []


      // 重置表单内容
      this.resetFormSubmitData({
        replaceObj: {
          lp_code: "123456", //曲线名称
        },
        exclude: [
          // 'curr_code'
        ]
      })
      this.dialogStatus = type
      this.dialogFormVisible = true
      this.$nextTick(() => {
        this.$refs.submitForm.$refs['dataForm'].clearValidate()
      })
    },
    // 行内按钮-修改数据弹窗（需要表单组件）
    handleUpdateEmit(row, type) {
      //曲线--待
      this.stayCurveCodeOptions = []
      //曲线--叠
      this.sppstCurveCodeOptions = []
      //曲线--合
      this.mergeCurveCodeOptions = []

      
      this.findTCCurveSuperpositionFingcurve(row.stay_type,'stayType')
      this.findTCCurveSuperpositionFingcurve(row.sppst_type,'sppstType')
      this.findTCCurveSuperpositionFingcurve(row.merge_type,'mergeType')



      // //期限点编号--待
      // this.stayTermCodeOptions = []
      // //期限点编号--叠
      // this.sppstTermCodeOptions = []
      // //期限点编号--合
      // this.mergeTermCodeOptions = []

      // this.formSubmitData = Object.assign({}, row) // copy obj

      const newRow = Object.assign({}, row)
      // 重置-拟合频率表单值
      const exct_fqc_arr = newRow.exct_fqc.split(' ')
      newRow.exct_fqc_minute = exct_fqc_arr[0]
      newRow.exct_fqc_hour = exct_fqc_arr[1]
      newRow.exct_fqc_day = exct_fqc_arr[2]
      newRow.exct_fqc_week = exct_fqc_arr[3]
      newRow.exct_fqc_month = exct_fqc_arr[4]
      this.formSubmitData = newRow // copy obj


      // 重置表单内容
      this.resetFormSubmitData({
        resetObj:this.formSubmitData,
        replaceObj: {
          // sppst_term_code:"", //期限点编号--叠
          // sppst_pct_value:"", //值--叠
          // sppst_term_code:"", //期限点编号--叠
          // sppst_pct_value:"", //值--叠
          // merge_term_code:"", //期限点编号--合
          // merge_term_code:"", //值--合 不需要传入
          // rfr_value:"", //参照倍数

        },
        exclude: [
          // 'curr_code'
        ]
      })

      // formSubmitData: {
      //   id: "",
      //   lp_code:"",
      //   s_date:"", //生效日期
      //   e_date:"", //失效日期

      //   stay_type:"", //类型--待
      //   stay_curve_code:"", //曲线--待
      //   stay_term_code:"", //期限点编号--待
      //   stay_pct_value:"", //值--待

      //   sppst_type:"", //类型--叠
      //   sppst_curve_code:"", //曲线--叠
      //   sppst_term_code:"", //期限点编号--叠
      //   sppst_pct_value:"", //值--叠

      //   merge_type:"", //类型--合
      //   merge_curve_code:"", //曲线--合
      //   merge_term_code:"", //期限点编号--合
      //   //merge_term_code:"", //值--合 不需要传入

      //   rfr_value:"", //参照倍数
      //   remark:"", //备注
      // },


      this.dialogStatus = type
      this.dialogFormVisible = true
      this.$nextTick(() => {
        this.$refs.submitForm.$refs['dataForm'].clearValidate()
      })
    },
    // 单行删除
    handleRmoveColEmit(row) {
      console.log("AJAX 请求删除单行数据");
      // this.$refs.exBaseTable.$refs.xTable.remove(row)
      deleteTCCurveSuperposition({
        id: row.id
      }).then(({data}) => {
        console.log('response:....', data);
        this.findList()
         this.findstay_type()
    this.findsppst_type()
    this.findmerge_type()
      }, error => {
        console.log('getList:error', error);
        // alert(error);
      })
    },
    //同步
    synctcd(row) {
      syncTCCurveSuperposition({
        id: row.id
      }).then(({data}) => {
        this.findList()
      }, error => {
        // alert(error);
      })
    },
    /* 表单组件相关 */
    // 更新
    handleFromUpdateDataEmit() {
      console.log("this.formSubmitDatathis.formSubmitDatathis.formSubmitDatathis.formSubmitData", this.formSubmitData);
      console.log("表单组件相关:此处运行更新数据操作api等");
      updateTCCurveSuperposition({
        ...this.formSubmitData,  //检索条件
      }).then(({data}) => {
        console.log('response:....', data);
        this.findList()
        //初始化 查询下拉框
        this.findstay_type()
        this.findsppst_type()
        this.findmerge_type()
      }, error => {
        console.log('getList:error', error);
        // alert(error);
      })
    },

    // 增加
    handleFromCreateDataEmit() {
      console.log("this.formSubmitDatathis.formSubmitDatathis.formSubmitDatathis.formSubmitData", this.formSubmitData);
      console.log("表单组件相关:此处运行添加数据操作api等");
      addTCCurveSuperposition({
        ...this.formSubmitData,  //检索条件
      }).then(({data}) => {
        this.findList()
        //初始化 查询下拉框
        this.findstay_type()
        this.findsppst_type()
        this.findmerge_type()
      }, error => {
        console.log('getList:error', error);
        // alert(error);
      })
    },

    /* 检索相关 */
    // 检索
    searchEventEmit() {
      this.tablePage.currentPage = 1
      this.findList()
    },
    // 重置
    resetSearchEventEmit() {
      // 重置代码...
      this.tablePage.currentPage = 1
      this.findList()
    },
    /* 排序 */
    customSortMethodEmit(property, order) {
      this.sortField = property
      this.sortFlag = order
      this.findList()
    },

    /* 曲线-待 */
    findstay_type() {
      findstay_type({}).then(({data}) => {
        this.findstay_typeOptions = data.rows
        this.findstay_typeSelectOptions = XEUtils.map(data.rows, (item) => {
          return {
            value: item.stay_curve_code,
            label: item.stay_curve_name
          }
        })
      }, error => {
        // alert(error);
      })
    },
   /* 曲线-叠 */
    findsppst_type() {
      findsppst_type({}).then(({data}) => {
        this.findsppst_typeOptions = data.rows
        this.findsppst_typeSelectOptions = XEUtils.map(data.rows, (item) => {
          return {
            value: item.sppst_curve_code,
            label: item.sppst_curve_name
          }
        })
      }, error => {
        // alert(error);
      })
    },
   /* 曲线-合*/
    findmerge_type() {
      findmerge_type({}).then(({data}) => {
        this.findmerge_typeOptions = data.rows
        this.findmerge_typeSelectOptions = XEUtils.map(data.rows, (item) => {
          return {
            value: item.merge_curve_code,
            label: item.merge_curve_name
          }
        })
      }, error => {
        // alert(error);
      })
    },

    /* 子表相关-期限字符串 */
    viewTimePointsManageTable(row) {
      console.log("rowrow", row);
      this.currentRow = Object.assign({}, row) // copy obj
      // 判断是否有时间和曲线数据
      this.isCheckSlecectDate(row,(status)=>{
        if (status) {
          this.dialogTimePointsManageTableVisible_title = '期限点'
          this.dialogTimePointsManageTableVisible = true
        }
      })
    }


  }, //method-end
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {
    // 初始化表格字段
    this.initTableCols()
    // 初始化表格数据
    this.findList()
    //初始化 查询下拉框
    this.findstay_type()
    this.findsppst_type()
    this.findmerge_type()

    // 初始化-查询类型状态Options
    this.findTCCurveSuperpositionFindsppstType()
  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {

  },
  beforeCreate() {
  }, // 生命周期 - 创建之前
  beforeMount() {
  }, // 生命周期 - 挂载之前
  beforeUpdate() {
  }, // 生命周期 - 更新之前
  updated() {
  }, // 生命周期 - 更新之后
  beforeDestroy() {
  }, // 生命周期 - 销毁之前
  destroyed() {
  }, // 生命周期 - 销毁完成
  activated() {
  }, // 如果页面有keep-alive缓存功能，这个函数会触发
}
</script>

<style lang='scss' scoped>


.my-dropdown4 {
  width: 600px;
  height: 300px;
  background-color: #fff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
}
</style>